package com.smedi.ismedi.progress.core.domain.aggregatemodel;

import com.smedi.ismedi.progress.api.dto.response.FileResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author liaojiajie
 * @date 2022/09/20
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class MilestoneListExport {

    /**
     * 任务名称前缀（序号）
     */
    private  String	namePrefix;
    /**
     * 名称
     */
    private String name;

    public void setScheduleEndTime(LocalDateTime scheduleEndTime) {
        if (scheduleEndTime != null) {
            this.scheduleEndTime = scheduleEndTime.getYear() + "年" + scheduleEndTime.getMonthValue() + "月" + scheduleEndTime.getDayOfMonth() + "日";
        }
    }

    public void setRealEndTime(LocalDateTime realEndTime) {
        if (realEndTime != null) {
            this.realEndTime = realEndTime.getYear() + "年" + realEndTime.getMonthValue() + "月" + realEndTime.getDayOfMonth() + "日";
        }
    }

    /**
     * 计划完成时间
     */
    private String scheduleEndTime;
    /**
     * 实际完成时间
     */
    private String realEndTime;
    /**
     * 完成情况(0、未完成  1、完成)
     */
    private String completion;

    public void setCompletion(Integer completion) {
        if (completion!=null) {
            if (completion == 0) {
                this.completion = "×";
            } else {
                this.completion = "√";
            }
        }
    }

    /**
     * 进度状态(0、滞后  1、正常)
     */
    private String status;

    public void setStatus(Long status) {
        if (status!=null) {
            if (status == 0) {
                this.status = "滞后";
            } else {
                this.status = "正常";
            }
        }
    }

    /**
     * 滞后时长
     */
    private String lagTime;

    public void setLagTime(Long lagTime) {
        this.lagTime = lagTime + "天";
    }

    /**
     * 照片文件信息
     */
    private List<FileResponse> photoFile;

    /**
     * 照片文件名称
     */
    private String photoName;

}